<?php
	function get_innermost_html_tag($tag, $subject, $matches=array()){
		$pattern = "#<$tag\b[^>]*>(?:(?=([^<]+))\1|<(?!$tag\b[^>]*>))*?</$tag>#";
		return preg_match($pattern, $subject, $matches);
	}
?>